        package com.tyqx.hashchainbackend.controller.config;

        import org.springframework.context.annotation.Bean;
        import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
        import springfox.documentation.builders.ApiInfoBuilder;
        import springfox.documentation.builders.PathSelectors;
        import springfox.documentation.builders.RequestHandlerSelectors;
        import springfox.documentation.service.ApiInfo;
        import springfox.documentation.service.Contact;
        import springfox.documentation.spi.DocumentationType;
        import springfox.documentation.spring.web.plugins.Docket;

        /**
 * Created by sam on 2018/4/20.
 */
//@EnableSwagger2
//@ComponentScan(basePackages = {"dcep.util","dcep.manager.controller"})
//@Configuration
public class SwaggerConfig extends WebMvcConfigurationSupport {


    @Bean
    public Docket createDocket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(getApiInfo()) //API信息
                .select() //扫描哪个路径下的哪些API
                .apis(RequestHandlerSelectors.basePackage("dcep.dcepbiz.controller"))
                .paths(PathSelectors.any())//任何路径
                .build();
    }

    private ApiInfo getApiInfo() {
        return new ApiInfoBuilder().title("dcep-spring项目Biz主业务模块")
                .contact(new Contact("lhb", "", ""))
                .version("V1.0").build();
    }


}
